﻿<div class="panel panel-default">
    <table class="table table-bordered table-striped" id="main_list">
        <thead>
            <tr>
                <th>名称</th>
                <th>文件大小</th>
                <th ng-show="folder_name">所在文件夹</th>
                <th ng-repeat="property in metaclass[meta.metaclass.PdmDocumentRev].ClassMeta.Class.Properties.Property" ng-show="property['show']"
                    data-resizable-column-id="{{property['@internalName']}}">
                    {{property['@displayname']}}
                </th>
                <!--<th ng-click="byname()" data-resizable-column-id="name"
                    ng-class="{true: 'active', false: 'inactive'}[nameIsActive]" ng-show="checkedname">
                    文件名称 <span>{{label4name}}</span>
                </th>
                <th ng-show="folder_name" data-resizable-column-id="filesize">所属文件夹</th>
                <th ng-show="checkedsize" data-resizable-column-id="filesize">文件大小</th>
                <th ng-show="checkedsourcerev" data-resizable-column-id="sourcerev">源版本</th>
                <th ng-show="checkedrevno" data-resizable-column-id="revno">版本号</th>
                <th ng-click="bycreator()" data-resizable-column-id="creator"
                    ng-class="{true: 'active', false: 'inactive'}[creatorIsActive]" ng-show="checkedcreator">
                    创建人 <span>{{label4creator}}</span>
                </th>
                <th ng-click="bycreationdate()" data-resizable-column-id="creationdate"
                    ng-class="{true: 'active', false: 'inactive'}[creationdateIsActive]" ng-show="checkedcdate">
                    创建日期 <span>{{label4creationdate}}</span>
                </th>-->
                <th data-resizable-column-id="detail">操作</th>
            </tr>
        </thead>
        <tbody>
            <tr ng-repeat="list in data | filterBy:['properties.name']: fileName | filterBy:['properties.creator']: creator | filterBy:['properties.creationdate']:createdDate | orderBy:orderby:orderflag">
                <!--文件夹打开-->
                <td class="docName" ng-if="list.type=='PdmFolder'" ng-click="subfolder(list)">
                    <!--<span class="glyphicon glyphicon-star" ng-if="list.tags.length!=0"></span>-->
                    <!--<span ng-if="list.tags.length==0">&nbsp;&nbsp;&nbsp;</span>-->
                    <img src="images/folder-thumbnail.png">
                    <a id="listName" target="_blank">{{list.properties.name}}</a>
                </td>
                <!--非文件夹打开-->
                <!--//图片-->
                <td class="docName" ng-if="list.type!=='PdmFolder' && list.properties.filetype=='png' || list.properties.filetype=='jpg' || list.properties.filetype=='gif'|| list.properties.filetype=='tif'"
                    ng-click="openImg()">
                    <img class="image" ng-src="{{list.properties.linkurl}}" style="cursor:pointer" />
                    <a id="listName" target="_blank" ng-click="openImg()">{{list.properties.name}}</a>
                </td>
                <!--//视频-->
                <td class="docName" ng-if="list.type!=='PdmFolder' && list.properties.filetype=='mp4'">
                    <img ng-src="{{list.properties.thumburl}}" />
                    <a id="listName" target="_blank" ng-href="{{list.properties.linkurl}}">{{list.properties.name}}</a>
                </td>
                <!--//PDF-->
                <td class="docName" ng-if="list.type!='PdmFolder' && list.properties.filetype=='pdf'">
                    <!--<span class="glyphicon glyphicon-star" ng-if="list.tags.length!=0"></span>-->
                    <!--<span ng-if="list.tags.length==0">&nbsp;&nbsp;&nbsp;</span>-->
                    <img ng-src="{{list.properties.thumburl}}" />
                    <a id="listName" target="_blank" ng-click="openPDF(list)">{{list.properties.name}}</a>
                </td>
                <!--//其它文件-->
                <td class="docName" ng-if="list.type!=='PdmFolder'&& list.properties.filetype!=='pdf' && list.properties.filetype!=='mp4'&& list.properties.filetype!=='png' && list.properties.filetype!=='jpg'&& list.properties.filetype!=='gif'&& list.properties.filetype!=='tif'">
                    <!--<span class="glyphicon glyphicon-star" ng-if="list.tags.length!=0"></span>-->
                    <!--<span ng-if="list.tags.length==0">&nbsp;&nbsp;&nbsp;</span>-->
                    <img ng-src="{{list.properties.thumburl}}" />
                    <a id="listName" target="_blank" ng-href="{{list.properties.linkurl}}">{{list.properties.name}}</a>
                </td>
                <td>{{bytesToSize(list.properties.filesize)}}</td>
                <td ng-show="folder_name" class="docName" ng-click="gotoFolder(list.properties.folder_id)">
                    <img src="images/folder-thumbnail.png">
                    <a>{{list.properties.folder_name}}</a>
                </td>
                <td ng-repeat="property in metaclass[meta.metaclass.PdmDocumentRev].ClassMeta.Class.Properties.Property" ng-show="property['show']">
                    {{list.properties[property['@internalName']]}}
                </td>
                <td>
                    <a class="btn btn-default pc" ng-if="list.type=='SysFile'||list.type=='PDMDOCUMENTREV'" ng-href="{{list.properties.downurl}}"
                        target="_blank">下载</a>
                    <input type="button" class="btn btn-default pc" ng-if="list.type==meta.metaclass.PdmFolder" ng-click="downfolder(list.id)"
                        value="下载" />
                    <button class="btn btn-default pc" data-toggle="modal" data-target="#edit" ng-click="openDetails(list)">详情</button>
                    <!-- 打标签 -->
                    <!-- <div class="btn-group pc">
                        <button ng-mousedown="clickLabelBtn(list)" type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                            标签 <span class="caret"></span>
                        </button>
                        <ul class="dropdown-menu">
                            <li ng-repeat="tag in list.tags">
                                <a ng-click="removeFavorite($index)">
                                    {{tag}}
                                    <span ng-if="tempList.tags!=null" class="glyphicon glyphicon-star" style="display:inline-block;float:right;"></span>
                                </a>
                            </li>
                            <li role="separator" class="divider"></li>
                            <li ng-repeat="tempLabel in tempLabels">
                                <a ng-click="addFavorite($index)">
                                    {{tempLabel}}
                                </a>
                            </li>
                        </ul>
                    </div> -->
                    <div class="dropdown mobile">
                        <button ng-mousedown="clickLabelBtn(list)" type="button" class="btn dropdown-toggle" id="dropdownMenu1" data-toggle="dropdown">
                            操作
                            <span class="caret"></span>
                        </button>
                        <ul class="dropdown-menu dropdown-right" role="menu" aria-labelledby="dropdownMenu1">
                            <li role="presentation">
                                <a role="menuitem" tabindex="-1" ng-href="{{list.properties.downurl}}" target="_blank" data-toggle="modal" data-target="#edit"
                                    ng-click="openDetails(list)">
                                    详情
                                </a>
                            </li>
                            <li role="separator" class="divider" ng-if="list.type=='PDMDOCUMENTREV'||list.type=='SysFile'"></li>
                            <li ng-if="list.type=='PDMDOCUMENTREV'">
                                <a role="menuitem" tabindex="-1" ng-href="{{list.properties.downurl}}" target="_blank">
                                    下载
                                </a>
                            </li>
                            <li role="separator" class="divider"></li>
                            <!-- <li ng-repeat="tag in list.tags">
                                <a ng-click="removeFavorite($index)">
                                    {{tag}}
                                    <span ng-if="tempList.tags!=null" class="glyphicon glyphicon-star" style="display:inline-block;float:right;"></span>
                                </a>
                            </li>
                            <li role="separator" class="divider"></li>
                            <li ng-repeat="tempLabel in tempLabels">
                                <a ng-click="addFavorite($index)">
                                    {{tempLabel}}
                                </a>
                            </li> -->
                        </ul>
                    </div>
                </td>
            </tr>
        </tbody>
    </table>
</div>